package zdream.pmfield.test.utils;

import org.junit.Test;

import zdream.utils.MathUtils;

import static org.junit.Assert.*;

/**
 * @author Zdream
 * @date 2023-12-14
 * @since 0.0.1
 */
public class MathUtilsCase {
	@Test
	public void testProbabilityOfCompositeRates() {
		final float[] rates = MathUtils.probabilityOfCompositeRates(new float[]{0.4f, 0.7f});
		assertEquals(3, rates.length);
		assertEquals(0.00001, 0.18, rates[0]);
		assertEquals(0.00001, 0.54, rates[1]);
		assertEquals(0.00001, 0.28, rates[2]);
	}
}
